using System.ComponentModel.DataAnnotations;
using SqlSugar;

namespace FytSoa.Domain.Erp;

/// <summary>
/// erp-bom物料表
/// </summary>
[SugarTable("erp_bom_product")]
public class ErpBomProduct:Entity
{
    /// <summary>
    /// Bom编号
    /// </summary>
    [Required]
    public long BomId { get; set; } = 0;
    
    /// <summary>
    /// 顺序
    /// </summary>
    [Required]
    public int Sequence { get; set; } = 1;

    /// <summary>
    /// 工序编号
    /// </summary>
    [Required]
    public long JobProcessId { get; set; } = 0;
    
    /// <summary>
    /// 工序信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(JobProcessId))]
    public ErpBomJob JobProcess { get; set; }

    /// <summary>
    /// 物料编号
    /// </summary>
    [Required]
    public long ProductId { get; set; }
    
    /// <summary>
    /// 物料信息
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(ProductId))]
    public ErpProduct Product { get; set; }

    /// <summary>
    /// 版本
    /// </summary>
    public string Version { get; set; }

    /// <summary>
    /// 数量
    /// </summary>
    [Required]
    public int Count { get; set; } = 0;

    /// <summary>
    /// 生产前置期-天
    /// </summary>
    [Required]
    public int LeadTime { get; set; } = 0;

    /// <summary>
    /// 创建人
    /// </summary>
    public string CreateUser { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Required]
    public DateTime CreateTime { get; set; } = DateTime.Now;

    /// <summary>
    /// 更新人
    /// </summary>
    public string UpdateUser { get; set; }

    /// <summary>
    /// 更新时间
    /// </summary>
    public DateTime? UpdateTime { get; set; }


}